package com.ljxt.dt.dao.storemanagementdao.impl;

import com.ljxt.dt.dao.storemanagementdao.EditDao;
import com.ljxt.dt.domain.ReceptType;
import com.ljxt.dt.util.DaoUtil;

import java.util.List;

/**
 * @author 唐春劲
 * @version 1.0.0
 * @date 2020-05-12 16:30
 * @copyright 老九学堂
 */

public class EditDaoImpl implements EditDao {
    @Override
    public boolean isEdit(String id) {
        String sql ="select id from bill_state where id =  (select state_id from recept_info where recept_no = ?) ";
        String result = DaoUtil.querySelectString(sql,id);

        return Integer.parseInt(result)==1;
    }

    @Override
    public List<ReceptType> selectType() {
        String sql ="select * from recept_type where state > 0 ORDER BY state";
        return DaoUtil.querySelectAll(sql,new ReceptType());
    }
}
